<?php
Class Data_Common extends Data_Base{

    /**
	 * 表名
	 *
	 * @var string
	 */
    static $table = 'season';
    /**
	 * 主键
	 * 
	 * @var  int
	 */
    static $primaryKey = 'id';
    /**
	 * 软删除标记
	 *
	 * @var int
	 */
    static $delflag = 'is_del';

    /**
	 * 构造函数
	 * 
	 * @access public
	 * @return void
	 */
    public function __construct() {
        parent::__construct ();
        parent::$table = self::$table;
        parent::$primaryKey = self::$primaryKey;
    }

    //获得当前最新赛季
    function getLastSeason(){
        $sql	="SELECT season FROM `Game_Data` group by season order by season desc limit 1";
        $datas	= $this->get_sql($sql);
        return $datas;
    }
    //获得当前最新轮次
    function getLastRound2($season){
        $sql ="SELECT round FROM `Schedule` where season='".$season."' group by round order by round desc limit 1";
        $datas = $this->get_sql($sql);
        return $datas;
    }

    //获得当前最新轮次
    function getLastRound($season){
        $sql ="SELECT round FROM `Game_Data` where season='".$season."' group by round order by round desc limit 1";
        $datas = $this->get_sql($sql);
        return $datas;
    }
}